﻿using CQRSDemo.Application.Abstractions.Messaging;
using CQRSDemo.Application.Orders.Queries.Response;

namespace CQRSDemo.Application.Orders.Queries.GetOrders;

internal sealed class GetOrdersQueryHandler : IQueryHandler<GetOrdersQuery, List<OrderResponse>>
{
    public Task<List<OrderResponse>> Handle(GetOrdersQuery request, CancellationToken cancellationToken)
    {
        return Task.FromResult(new List<OrderResponse>()
        {
            new OrderResponse()
            {
                Id = 1,
            },
            new OrderResponse()
            {
                Id = 2,
            }
        });
    }
}